Error detection code generating circuit and encoding circuit utilizing which and method thereof

ABSTRACT

An encoding circuit comprising: a memory unit; an EDC generating circuit, a scrambler, a header generator, an EDC correcting circuit and an decoder. The EDC generating circuit is used for generating a first EDC according to at least one main data, and for storing the first EDC to the memory unit. The scrambler is used for generating a scrambled main data according to the main data, and for storing the scrambled main data to the memory unit. The header generator is used for generating a header according to header information. The EDC correcting circuit is used for reading the first EDC from the memory unit and for correcting the first EDC according to the header to generate a second EDC. The encoder is used for encoding optical data according to the second EDC and the scrambled main data.

CROSS REFERENCE TO RELATED APPLICATIONS

This divisional application claims the benefit of co-pending U.S.application Ser. No. 12/023,048, filed on Jan. 31, 2008 and incorporatedherein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an error detection code generatingcircuit, an encoding circuit utilizing which and related methodsthereof, and particularly relates to an optical data error detectioncode generating circuit, an encoding circuit utilizing which and relatedmethods thereof.

2. Description of the Prior Art

Conventionally, a DVD optical disc comprises continuous error correctioncode block (ECC block), and a DVD optical disc includes at least 143500ECC blocks, which is illustrated as conform tos. FIG. 1 is a schematicdiagram illustrating the ECC block 100 in a DVD optical disc. As shownin FIG. 1, each ECC block has 208 (192+16) rows, and each of them has182 bytes (172+10). The first 172 bytes of each row is used for storingdata to be recorded to the optical disc, and the information stored inthe last 10 bytes is the PI (Parity of the Inner code). Also, the last16 rows of each ECC block are called PO (Parity of the Outer code).Briefly, PI and PO are the checking codes for reading data recoded tothe optical disc correctly. One method to generate PI and PO isutilizing Reed-Solomon codes.

Besides, the ECC block 100 includes 16 sectors (only sectors 101, 102,and 103 are illustrated). Each sector includes 2048 bytes of main data,12 bytes of header and 4 bytes of error detection code (EDC). The headeralways includes 1 byte of sector information, 3 bytes of ID number, 2bytes of IED (the EDC, error detection code, of the ID number), and 6bytes of other information (CPRMAI).

Conventionally, an optical encoding system has a memory unit, a bus, atransmitting interface, a scrambler, a header generator, an EDCgenerator and an encoder, wherein the transmitting interface, thescrambler, the header generator, the EDC generator and the encoder arerespectively coupled to the memory unit. The transmission interface canbe ATAPI (Advanced Technology Attachment/ATA packet Interface, which isinstituted by team X3T1Q of American National Standards Institute). Thetransmission interface is utilized to receive main data and transmit itto the memory unit; the scrambler is utilized for scrambling the maindata; the header generator is utilized for receiving head information togenerate a header, the EDC generator is utilized for generating EDCaccording to the main data and header; and the encoder is utilized toperform encoding for PI/PO encoding according to the header, main dataand EDC. The disadvantage of such a system is that the scrambler mustread and write back data of whole sector, and therefore, large bandwidthis needed. Additionally, according to structure of the optical discencoding system, the EDC generator needs to read a whole sector togenerate only 4 bytes EDC, which is inefficient.

SUMMARY OF THE INVENTION

Therefore, one objective of the present invention is to provide an EDCgenerating circuit, which can decrease the bandwidth needed for the EDCin the circumstance that the transmission interface and the headergenerator are independent.

Another objective of the present invention is to provide an encodingcircuit, which can utilize minimum bandwidth for the EDC in thecircumstance that the transmission interface and the header generatorare independent.

One embodiment of the present invention discloses an encoding circuit,which comprises: a memory unit; an EDC generating circuit, a scrambler,a header generator, an EDC correcting circuit and an decoder. The EDCgenerating circuit, which is coupled to the memory unit, is used forgenerating a first EDC according to at least one main data, and forstoring the first EDC to the memory unit. The scrambler, which iscoupled to the memory unit, is used for generating a scrambled main dataaccording to the main data, and for storing the scrambled main data tothe memory unit. The header generator, which is coupled to the memoryunit, is used for generating a header according to header information.The EDC correcting circuit, which is coupled to the memory unit, is usedfor reading the first EDC from the memory unit and for correcting thefirst EDC according to the header to generate a second EDC. The encoder,which is coupled to the memory unit, is used for encoding optical dataaccording to the second EDC and the scrambled main data.

Another embodiment of the present invention discloses an encoding methodfor encoding an optical data to be recorded to an optical disc, whichcomprises generating a first EDC according to at least one main data,generating a scrambled main data according to the main data, generatinga header according to header information, correcting the first EDCaccording to the header to generate a second EDC, and encoding theoptical data according to the second EDC and the scrambled main data.

In the above-mentioned embodiments, the main data and the header areprocessed independently, thus the above-mentioned harmonizing problemcan be avoided. Also, the EDC generating circuit does not need to readall data from the memory unit, and the bandwidth necessary for datareading can decrease.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment that isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram illustrating the ECC block in a DVDoptical disc.

FIG. 2 is an optical disc data EDC generating circuit according to afirst embodiment of the present invention.

FIG. 3 is an optical disc data EDC generating circuit according to asecond embodiment of the present invention.

FIG. 4 is an optical disc EDC generating method according to anembodiment of the present invention.

FIG. 5 is an optical data encoding system according to a firstembodiment of the present invention.

FIG. 6 is an optical data encoding system according to a secondembodiment of the present invention.

FIG. 7 is an optical data encoding system according to a thirdembodiment of the present invention.

FIG. 8 is an optical data encoding method according to a thirdembodiment of the present invention.

DETAILED DESCRIPTION

Certain terms are used throughout the description and following claimsto refer to particular components. As one skilled in the art willappreciate, electronic equipment manufacturers may refer to a componentby different names. This document does not intend to distinguish betweencomponents that differ in name but not function. In the followingdescription and in the claims, the terms “include” and “comprise” areused in an open-ended fashion, and thus should be interpreted to mean“include, but not limited to . . . ”. Also, the term “couple” isintended to mean either an indirect or direct electrical connection.Accordingly, if one device is coupled to another device, that connectionmay be through a direct electrical connection, or through an indirectelectrical connection via other devices and connections.

FIG. 2 is an optical disc data EDC generating circuit 200 according to afirst embodiment of the present invention. As shown in FIG. 2, theoptical disc data EDC generating circuit 200 includes a memory unit 201,a bus 202, an EDC generating circuit 203, a transmitting interface 205,a header generator 207 and an EDC correcting circuit 209. Thetransmitting interface 205 is used for receiving main data MD. The EDCgenerating circuit 203, which is coupled to the memory unit 201 via thebus 202, is used for generating a first EDC (EDC₁) according to at leastone main data MD, and for storing EDC₁ to the memory unit 201. Theheader generator 207, which is coupled to the memory unit 201, is usedfor generating a header H according to header information HI. The EDCcorrecting circuit 209, which is coupled to the memory unit 201, is usedfor reading the EDC₁ from the memory unit 201 and for correcting theEDC₁ according to the header H to generate a second EDC (EDC₂).

Besides above-mentioned operations, the EDC generating circuit 203 canfurther combine the main data MD and a substitute data Z of the header Hto generate a first data, and generate the EDC, according to the firstdata. Furthermore, the EDC correcting circuit 209 combines the main dataMD and the substitute data Z of the header H to generate a second data,and amends the EDC, according to the second data to generate EDC₂. Ifthe substitute data Z equals 0, it can be regarded that no substitutedata is added.

The operation of the optical disc data EDC generating circuit 200 isexplained via FIG. 2 and the following equations. It should be notedthat the following equations are only examples and do not mean to limitthe scope of the present invention. Persons skilled in the art canfreely change the equation to obtain substantially the same functionunder the concept of the present invention, which should also fall inthe scope of the present invention.

F(x) = main_data(x) ⊕ header(x) M(X) = z(x) ⊕ main_data(x)H(x) = z(x) ⊕ header(x) F(x) = M(x) ⊕ H(X)EDC(x) = F(x) mod P(x) = (M(x) ⊕ H(x))mod P(x) = [M(x)mod P(x)] ⊕ [H(x)mod P(x)] = EDC_m(x) ⊕ EDC_h(x)

In these equations, F(x) is assumed to be a multinomial for EDCencoding, which can include main_data (x) (main data MD) and header (x)(header H). Before a correct header is obtained, the EDC generatingcircuit 203 adds a random z(x) (i.e. the substitute data Z) to correctmain_data (x) and divides the combination with a predeterminedmultinomial P(x), such that an EDC_m(x) (i.e. EDC₁) is obtained and isstored to the memory unit 201. After the header generator 207 obtainsthe correct H (header (x)) according to the header information HI, theEDC correcting circuit 209 adds the same substitute data z(x) to theheader (x), and the combination is also divided by the predeterminedmultinomial P(x) to obtain EDC_h(x). Finally, an XOR operation isperformed on the EDC_m(x) and EDC_h(x), with the effect of Z(x) beingcancelled out by the XOR operation, such that a correct EDC(x) (I.e.EDC₂) can be generated by an XOR operation on EDC_m(x) and EDC_h(x). Ifthe added Z(x)=0, H(x)=header (x), and M(x)=main_data (x), then it canbe regarded that no Z(x) is added.

According to this mechanism, the transmitting interface 206 and theheader generator 207 can operate in parallel, and the interface canutilize a DMA port, which is suited for communications over IPaddressing. Also, the EDC generating circuit 203 does not need to readall data (2060 bytes), but only needs to read the ID field (12 bytes)and the EDC_m(x) (4 bytes), and writes back the correct EDC (x) (4bytes) after correcting, and thereby 2044 bytes of accessing operationcan be saved.

FIG. 3 is an optical disc data EDC generating circuit 300 according to asecond embodiment of the present invention. The optical disc data EDCgenerating circuit 300 includes a memory unit 301, a bus 302, an EDCgenerating circuit 303, a transmitting interface 305, an EDC correctingcircuit 307 and a header generator 309. The difference between theoptical disc data EDC generating circuits 300 and 200 is that the headergenerator 309 of the optical disc data EDC generating circuit 300 isfurther coupled to the EDC correcting circuit 307, therefore the EDCcorrecting circuit 307 can directly receive the header H from the headergenerator 309, and amends the EDC1 according to the header H to generateEDC2. By this way, the computing and operation time of the headergenerator 309 can be shortened.

The operation of the optical disc data EDC generating circuits 200 and300 can be integrated to the steps shown in FIG. 4. FIG. 4 is an opticaldisc EDC generating method according to an embodiment of the presentinvention, which includes:

Step 401

Generate a first EDC according to at least one main data.

Step 403

Generate a header according to header information.

Step 405

Amend the first EDC according to the header to generate a second EDC.

Since the method corresponds to the optical disc data EDC generatingcircuits 200 and 300, the detailed characteristics can be obtained bythe above-mentioned description, and thus is omitted for brevity.

FIG. 5 is an optical data encoding system 500 according to a firstembodiment of the present invention. The optical data encoding system500 corresponds to the optical disc data EDC generating circuits 200shown in FIG. 2. Besides the optical disc data EDC generating circuits200 shown in FIG. 2, the optical data encoding system 500 furtherincludes a scrambler 501 and an encoder 503. The scrambler 501 receivesmain data MD, and scrambles main data MD to generate scrambled main dataDMD and stores scrambled main data DMD to the memory unit 201. Also, theencoder 503 encodes according to scrambled main data DMD, header H andEDC2 to generate PI, PO.

FIG. 6 is an optical data encoding system 600 according to a secondembodiment of the present invention. The optical data encoding system600 corresponds to the optical disc data EDC generating circuits 300shown in FIG. 3. Similarly, the difference between the optical dataencoding system 600 and the optical disc data EDC generating circuits300 is that the optical data encoding system 600 further includes ascrambler 601 and an encoder 603. The scrambler 601 receives main dataMD, and scrambles main data MD to generate scrambled main data DMD andstores scrambled main data DMD to the memory unit 301. Also, the encoder603 encodes according to scrambled main data DMD, header H and EDC2 togenerate PI, PO.

FIG. 7 is an optical data encoding system 700 according to a thirdembodiment of the present invention. The optical data encoding system700 includes the same elements as the optical data encoding systems 500and 600, but has different connection types. As shown in FIG. 7, the EDCcorrecting circuit 701 is coupled to the encoder 703. Thus the EDC1 andthe header H are stored in the memory unit 705 in this embodiment, thenthe EDC correcting circuit 701 reads the EDC1 and the header H from thememory unit 705, and amends the EDC1 according to the header H togenerate the EDC2. The encoder 703 encodes according to scrambled maindata DMD, header H and EDC2 to generate PI, PO. Please note that the EDCcorrecting circuit 701 finishes the operation of correcting EDC beforethe encoder 703 utilizes the EDC2 to perform PI/PO encoding.

FIG. 8 is an optical data encoding method according to a thirdembodiment of the present invention, which corresponds to the circuitsshown in FIG. 5 to FIG. 7. The method includes:

Step 801

Generate a first EDC according to at least one main data.

Step 803

Generate a scrambled main data according to the main data.

Step 805

Generate a header according to header information.

Step 807

Amend the first EDC according to the header to generate a second EDC.

Step 809

Encode the optical data according to the second EDC and the scrambledmain data.

Since the method corresponds to the optical disc data EDC generatingcircuits 500, 600 and 700, the detailed characteristics can be obtainedby the above-mentioned description, and thus are omitted for brevity.

In the above-mentioned embodiments, a substitute data Z is utilized tosubstitute a correct header temporarily (i.e., a substitute headersubstituting the correct header) to generate a temporary EDC. Also, theeffect of the substitute header is removed to generate correct EDC afterthe correct header is obtained. Since main data and header are processedin parallel, the above-mentioned harmonizing problem can be avoided.Besides, the EDC generating circuit does not need read whole data fromthe memory unit, such that the bandwidth used for reading data can besaved. It should be noted that a DVD is utilized in the above mentionedembodiments as an example, but it does not mean to limit the scope ofthe present invention. The circuit and method according to theembodiments of the present invention can be utilized to other types ofoptical discs, of course, and can be utilized to data besides opticaldisc data, too. Such variations should also fall in the scope of thepresent invention.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

1. An encoding circuit, comprising: a memory unit; an EDC generatingcircuit, coupled to the memory unit, for generating a first EDCaccording to at least one main data, and for storing the first EDC tothe memory unit; a scrambler, coupled to the memory unit, for generatinga scrambled main data according to the main data, and for storing thescrambled main data to the memory unit; a header generator, coupled tothe memory unit, for generating a header according to headerinformation; an EDC correcting circuit, coupled to the memory unit, forreading the first EDC from the memory unit and for correcting the firstEDC according to the header to generate a second EDC; and an encoder,coupled to the memory unit, for encoding an optical data according tothe second EDC and the scrambled main data.
 2. The encoding circuit ofclaim 1, utilized for encoding the optical disc data to be recorded toan optical disc.
 3. The encoding circuit of claim 1, wherein the EDCgenerating circuit further generates a first data according to the maindata and a substitute data of the header, and generates the first EDCaccording to the first data.
 4. The encoding circuit of claim 3, whereinthe EDC correcting circuit generates a second data according to theheader and the substitute data, and amends the first EDC according tothe second data to generate the second EDC.
 5. The encoding circuit ofclaim 1, wherein the main data and the header conform to a DVD standard.6. The encoding circuit of claim 1, wherein the header generator iscoupled to the memory unit and stores the header to the memory unit, andthe EDC correcting circuit further reads the header from the memory unitand amends the first EDC according to the header to generate the secondEDC.
 7. The encoding circuit of claim 1, wherein the EDC correctingcircuit is further coupled to the header generator, and the EDCcorrecting circuit receives the header from the header generator andamends the first EDC according to the header to generate the second EDC.8. The encoding circuit of claim 1, wherein the header generator storesthe header to the memory unit, and the encoder is further coupled to theEDC correcting circuit, for reading the scrambled main data and theheader from the memory unit, for receiving the second EDC from the EDCcorrecting circuit, and for generating an encoded data according to thescrambled main data, the header and the second EDC.
 9. An encodingmethod, for encoding an optical data to be recorded to an optical disc,comprising: generating a first EDC according to at least one main data;generating a scrambled main data according to the main data; generatinga header according to header information; correcting the first EDCaccording to the header to generate a second EDC; and encoding theoptical data according to the second EDC and the scrambled main data.10. The encoding method of claim 9, wherein the step of generating thefirst EDC further comprises: generating a first data according to themain data and a substitute data of the header; and generating the firstEDC according to the first data.
 11. The encoding method of claim 10,wherein the step of generating the second EDC further comprises:generating a second data according to the header and the substitutedata; and correcting the first EDC according to the second data togenerate the second EDC.